import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {TreeNode} from 'primeng/primeng';
import { Observable } from 'rxjs/Rx';
@Injectable()
export class NodeService {

    constructor(private http: Http) {}

    getFiles() {
      return this.http.get('app/resources/data/files.json').map(res => {
      return res.json().data;
      });

    }

    getLazyFiles() {
      return this.http.get('app/resources/data/files-lazy.json').map(res => {
      return res.json().data;
      });

    }

    getFilesystem() {
        return this.http.get('app/resources/data/filesystem.json').map(res => {
        return res.json().data;
      });

    }

    getLazyFilesystem() {
      return this.http.get('app/resources/data/filesystem-lazy.json').map(res => {
      return res.json().data;
    });

  }
}
